<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="./css/register/zc.css">
    <link rel="shortcut icon" href="./img/blog-sy/favicon.ico" type="image/x-icon">
    <title>班级博客-注册页</title>
    <div class="con">
        <h1>班级博客-注册页</h1>
        <div style="height:70%;width:100%;">
            <form action="" class="zc">
                <input type="text" name='users_email' placeholder="请输入用户邮箱" class="email"><br>
                <input type="text" name='users_name' placeholder="请输入用户名" class="usename"><br>
                <input type="password" placeholder="请输入密码" class='password'><br>
                <input type="password" name='users_password' placeholder="确认密码" class="password2">
                <input class='zcbtn' type="button" value="注册">
                <p style="margin-left:30px;">已有账号点击,<a href="/login">登录</a></p>
            </form>
        </div>
    </div>
    <div class="reg-bottom">
        <p
            style="font-size: 17px;    margin: 0; color: #7f8c8d;padding: 15px 0;text-align: center;background: #2d3e50;">
            Copyright ©2019 <a href="#" style="color: #0e90d2;">Cnblogs, Inc.</a> Powered by ASP.NET Core on
            Linux. <a href="#" style="color: #0e90d2;"><span class="iconfont"></span>问题反馈</a>&nbsp;<a
                style="color: #0e90d2;" href="#" target="_blank">帮助文档</a>
        </p>
    </div>
    <script src="./js/register/zc.js"></script>
    <script src="./lib/jquery-3.3.1.js"></script>
    <script>
        // 注册页面
        $('.zcbtn').on('click', function () {
            if ($('.email').val() != '' && $('.username').val() != '' && $('.password2').val() != '' && $('.password').val() != '') {
                let data = $('form').serialize();
                $.ajax({
                    type: 'post',
                    url: '/addUser',
                    data: data,
                    success: function (data) {
                        if (data.code == '1000') {
                            alert('用户注册成功');
                            location.href = '/login';
                        }
                    }

                })
            }
        })
     
       
    </script>
</head>

<body>

</body>

</html>